package powerdev.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class BuscarCancha2
 */
@WebServlet("/BuscarCancha")
public class BuscarCancha extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public BuscarCancha() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		Integer a=Integer.parseInt(request.getParameter("cboDistrito"));
		String b=request.getParameter("txtFechaInicio");
		String c=request.getParameter("txtFechaFin");
		String d=request.getParameter("txtHoraInicio");
		String e=request.getParameter("txtHoraFin");
		
		//String msg = "Datos a Buscar: " + a + " " + b+ " " + c+ " " + d+ " " + e;
		
		request.setAttribute("MENSAJE1", a);
		request.setAttribute("MENSAJE2", b);
		request.setAttribute("MENSAJE3", c);
		request.setAttribute("MENSAJE4", d);
		request.setAttribute("MENSAJE5", e);
		
		//llamar al otro JSP
		RequestDispatcher rd = request.getRequestDispatcher("Resultado_BuscarCancha.jsp");
		rd.forward(request, response);
		
	}

}
